import {nanoid} from "nanoid"

export default function(){
    //从本地存储里面取userTempId
    let userTempId = localStorage.getItem("userTempId")
    //如果取不到值，则给他随机定义一个
    if(!userTempId){
        userTempId = nanoid()
        //并将这个值保存到本地
        localStorage.setItem("userTempId",userTempId)
    }

    return userTempId
}